﻿#ifndef BUTTERFLY_H
#define BUTTERFLY_H

#include <QWidget>

class butterfly : public QWidget {
  Q_OBJECT
 public:
  explicit butterfly(QWidget* parent = nullptr);
  void fly();
  void fly(int min, int max);

 protected:
  void paintEvent(QPaintEvent* ev);       //画图事件
  void timerEvent(QTimerEvent* ev);       //定时器事件
  void mousePressEvent(QMouseEvent* ev);  //鼠标点击事件
  void mouseMoveEvent(QMouseEvent* ev);   //鼠标移动事件
  void enterEvent(QEvent* ev);            //

 private:
  int m_index = 1;
  QPixmap m_pixmap;
  QPoint m_pt;
 signals:
};

#endif  // BUTTERFLY_H
